export const translateLanguage = function async(lang: string) {
    // this is a list of all Github supported languages
    // that have known aliases
    // aliases with non URL safe characters have been removed
    // https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
    // some keys added (cs: C#) etc.
    const dict: {[id: string]: string} = {
        ags: 'AGS Script',
        aspx: 'ASP.NET',
        ats2: 'ATS',
        actionscript3: 'ActionScript',
        as3: 'ActionScript',
        ada95: 'Ada',
        ada2005: 'Ada',
        acfm: 'Adobe Font Metrics',
        amfm: 'Adobe Font Metrics',
        abuild: 'Alpine Abuild',
        apkbuild: 'Alpine Abuild',
        altium: 'Altium Designer',
        aconf: 'ApacheConf',
        apache: 'ApacheConf',
        osascript: 'AppleScript',
        asm: 'Assembly',
        nasm: 'Assembly',
        ahk: 'AutoHotkey',
        au3: 'AutoIt',
        AutoIt3: 'AutoIt',
        AutoItScript: 'AutoIt',
        bat: 'Batchfile',
        batch: 'Batchfile',
        dosbatch: 'Batchfile',
        winbatch: 'Batchfile',
        be: 'Berry',
        b3d: 'BlitzBasic',
        blitz3d: 'BlitzBasic',
        blitzplus: 'BlitzBasic',
        bplus: 'BlitzBasic',
        bmax: 'BlitzMax',
        csharp: 'C#',
        cs: 'C#',
        cake: 'C#',
        cakescript: 'C#',
        cpp: 'C++',
        c2hs: 'C2hs Haskell',
        cds: 'CAP CDS',
        Cabal: 'Cabal Config',
        Carto: 'CartoCSS',
        chpl: 'Chapel',
        checksum: 'Checksums',
        hash: 'Checksums',
        hashes: 'Checksums',
        sum: 'Checksums',
        sums: 'Checksums',
        asp: 'Classic ASP',
        soy: 'Closure Templates',
        CoNLL: 'CoNLL-U',
        ql: 'CodeQL',
        coffee: 'CoffeeScript',
        cfm: 'ColdFusion',
        cfml: 'ColdFusion',
        cfc: 'ColdFusion CFC',
        lisp: 'Common Lisp',
        cwl: 'Common Workflow Language',
        pyrex: 'Cython',
        Dlang: 'D',
        dcl: 'DIGITAL Command Language',
        byond: 'DM',
        dpatch: 'Darcs Patch',
        udiff: 'Diff',
        Containerfile: 'Dockerfile',
        email: 'E-mail',
        eml: 'E-mail',
        mail: 'E-mail',
        mbox: 'E-mail',
        Earthfile: 'Earthly',
        elisp: 'Emacs Lisp',
        emacs: 'Emacs Lisp',
        fsharp: 'F#',
        fstar: 'F*',
        FIGfont: 'FIGlet Font',
        fb: 'FreeBasic',
        ftl: 'FreeMarker',
        pot: 'Gettext Catalog',
        cucumber: 'Gherkin',
        gitattributes: 'Git Attributes',
        gitconfig: 'Git Config',
        gitmodules: 'Git Config',
        golang: 'Go',
        gf: 'Grammatical Framework',
        gsp: 'Groovy Server Pages',
        terraform: 'HCL',
        xhtml: 'HTML',
        ecr: 'HTML+ECR',
        eex: 'HTML+EEX',
        heex: 'HTML+EEX',
        leex: 'HTML+EEX',
        erb: 'HTML+ERB',
        rhtml: 'HTML+ERB',
        razor: 'HTML+Razor',
        hbs: 'Handlebars',
        htmlbars: 'Handlebars',
        hylang: 'Hy',
        igor: 'IGOR Pro',
        igorpro: 'IGOR Pro',
        dosini: 'INI',
        irc: 'IRC log',
        ignore: 'Ignore List',
        gitignore: 'Ignore List',
        ijm: 'ImageJ Macro',
        i7: 'Inform 7',
        inform7: 'Inform 7',
        geojson: 'JSON',
        jsonl: 'JSON',
        topojson: 'JSON',
        jsonc: 'JSON with Comments',
        jsp: 'Java Server Pages',
        js: 'JavaScript',
        node: 'JavaScript',
        mps: 'JetBrains MPS',
        django: 'Jinja',
        htmldjango: 'Jinja',
        ksy: 'Kaitai Struct',
        kak: 'KakouneScript',
        kakscript: 'KakouneScript',
        pcbnew: 'KiCad Layout',
        lassoscript: 'Lasso',
        flex: 'Lex',
        litcoffee: 'Literate CoffeeScript',
        lhaskell: 'Literate Haskell',
        lhs: 'Literate Haskell',
        ls: 'LiveScript',
        mumps: 'M',
        autoconf: 'M4Sugar',
        octave: 'MATLAB',
        m2: 'Macaulay2',
        bsdmake: 'Makefile',
        make: 'Makefile',
        mf: 'Makefile',
        pandoc: 'Markdown',
        markojs: 'Marko',
        mma: 'Mathematica',
        wolfram: 'Mathematica',
        wl: 'Mathematica',
        maxmsp: 'Max',
        m68k: 'Motorola 68K Assembly',
        amusewiki: 'Muse',
        npmrc: 'NPM Config',
        nixos: 'Nix',
        nush: 'Nu',
        njk: 'Nunjucks',
        objc: 'Objective-C',
        objectivec: 'Objective-C',
        objectivej: 'Objective-J',
        objj: 'Objective-J',
        odinlang: 'Odin',
        progress: 'OpenEdge ABL',
        openedge: 'OpenEdge ABL',
        abl: 'OpenEdge ABL',
        openrc: 'OpenRC runscript',
        AFDKO: 'OpenType Feature File',
        inc: 'PHP',
        povray: 'POV-Ray SDL',
        pasm: 'Parrot Assembly',
        pir: 'Parrot Internal Representation',
        delphi: 'Pascal',
        objectpascal: 'Pascal',
        cperl: 'Perl',
        postscr: 'PostScript',
        posh: 'PowerShell',
        pwsh: 'PowerShell',
        protobuf: 'Protocol Buffer',
        python3: 'Python',
        py: 'Python',
        rusthon: 'Python',
        pycon: 'Python console',
        qsharp: 'Q#',
        R: 'R',
        Rscript: 'R',
        splus: 'R',
        arexx: 'REXX',
        rpcgen: 'RPC',
        oncrpc: 'RPC',
        xdr: 'RPC',
        sqlrpgle: 'RPGLE',
        specfile: 'RPM Spec',
        perl6: 'Raku',
        raw: 'Raw token data',
        inputrc: 'Readline Config',
        readline: 'Readline Config',
        redirects: 'Redirect Rules',
        regexp: 'Regular Expression',
        regex: 'Regular Expression',
        renpy: "Ren'Py",
        groff: 'Roff',
        man: 'Roff',
        manpage: 'Roff',
        mdoc: 'Roff',
        nroff: 'Roff',
        troff: 'Roff',
        jruby: 'Ruby',
        macruby: 'Ruby',
        rake: 'Ruby',
        rb: 'Ruby',
        rbx: 'Ruby',
        rs: 'Rust',
        sepolicy: 'SELinux Policy',
        stla: 'STL',
        saltstate: 'SaltStack',
        salt: 'SaltStack',
        sh: 'Shell',
        bash: 'Shell',
        zsh: 'Shell',
        shellcheckrc: 'ShellCheck Config',
        console: 'ShellSession',
        coccinelle: 'SmPL',
        squeak: 'Smalltalk',
        sourcemod: 'SourcePawn',
        sml: 'Standard ML',
        bazel: 'Starlark',
        bzl: 'Starlark',
        latex: 'TeX',
        fundamental: 'Text',
        tl: 'Type Language',
        ts: 'TypeScript',
        gas: 'Unix Assembly',
        Ur: 'UrWeb',
        vlang: 'V',
        vb6: 'VBA',
        keyvalues: 'Valve Data Format',
        vdf: 'Valve Data Format',
        vtl: 'Velocity Template Language',
        velocity: 'Velocity Template Language',
        help: 'Vim Help File',
        vimhelp: 'Vim Help File',
        vim: 'Vim Script',
        viml: 'Vim Script',
        nvim: 'Vim Script',
        SnipMate: 'Vim Snippet',
        UltiSnip: 'Vim Snippet',
        UltiSnips: 'Vim Snippet',
        NeoSnippet: 'Vim Snippet',
        vbnet: 'Visual Basic .NET',
        wast: 'WebAssembly',
        wasm: 'WebAssembly',
        vtt: 'WebVTT',
        wgetrc: 'Wget Config',
        mediawiki: 'Wikitext',
        wiki: 'Wikitext',
        wrenlang: 'Wren',
        xbm: 'X BitMap',
        xpm: 'X PixMap',
        xten: 'X10',
        rss: 'XML',
        xsd: 'XML',
        wsdl: 'XML',
        xsl: 'XSLT',
        yml: 'YAML',
        snippet: 'YASnippet',
        yas: 'YASnippet',
        bro: 'Zeek',
        curlrc: 'cURL Config',
        rst: 'reStructuredText',
        robots: 'robots.txt',
        advpl: 'xBase',
        clipper: 'xBase',
        html: 'HTML',
        foxpro: 'xBase'
    };
    if (dict[lang] !== undefined) {
        return dict[lang];
    }
    return lang.charAt(0).toUpperCase() + lang.slice(1);
};
